<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../lib/vue.js"></script>
</head>
<body>
  <div id="app">
    <News>
      <template #title="test">这是传入的title--{{test}}</template>
      <template #default>123</template>
    </News>
  </div>

  <script>
    // {_data: ___}   => this.xxx => this._data   => this.t  => this._props
    const News = {
      data() {
        return {
          obj: {
            name: "newsname",
            age: 15
          },
          user: {
            id: 15
          }
        }
      },
      props: ['t'],
      // vm._data    this.obj  => this._data.obj
      template: `<div>
          <h3>
            <slot name="title" v-bind="_data">default title</slot>
          </h3>
          <div>
            <slot name="default"></slot>
          </div>
        </div>`
    }
    // => allAttributes = > {give:{}, nihao: {}}


    // v-bind  => :
    // v-on => @
    // v-slot => #

    const app = new Vue({
      el: "#app",
      components: {News}
    })



  </script>
</body>
</html>
